<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>福利列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<style>
	table{
		font-size:12.5px
	}
</style>
<script>
	//更改每页记录数的方法
	function dochangeRow(){
		var rows=document.form1.rows.value;
		if(isNaN(rows)){
			alert('请输入正确的整数数字！');
			document.form1.rows.value=${pb.rows};
			return;
		}
		window.location="findAll_ewf_Emp.action?rows="+rows;
	}
	//更改每页记录数的方法
	function dochangePage(){
		var page=document.form1.page.value;
		if(isNaN(page)){
			alert('请输入正确的整数数字！');
			document.form1.page.value=${pb.page};
			return;
		}
		window.location="findAll_ewf_Emp.action?page="+page;
	}
	
	function dodel(ename){
		return window.confirm('是否真的删除'+ename+'的信息！');
	}
</script>
  </head>
  <p align="center">员工福利</p>
  <body>
    <table width="770" border="1" align="center" cellpadding="1" cellspacing="1">
  <tr align="center" bgcolor="#FFFF99">
    <td width="91">编号</td>
    <td width="91">员工</td>
    <td width="132">福利</td>
    <td width="145" bgcolor="#FFFF99">操作</td>
  </tr>
 <s:iterator value="#session.lst" var="ewf">
  <tr align="center">
    <td>${ewf.ewid}</td>
    <td>${ewf.emp.ename}</td>
    <td>${ewf.welfare.wname}</td>
    <td><a href="#" onclick="return dodel('${emp.ename}')">删除</a> <a href="#">修改</a></td>
  </tr>
  </s:iterator>
</table>
<form id="form1" name="form1" method="post" action="">
  <table width="770" border="1" align="center" cellpadding="1" cellspacing="1">
    <tr align="center" bgcolor="#FFFF99">
      <td>
      	<s:if test="#session.pb.page>1">
      		<a href="findAll_ewf.action?page=1">首页</a>
      	</s:if>
      	<s:else>
      		首页
      	</s:else>
      </td>
      <td>
      	<s:if test="#session.pb.page>1">
      		<a href="findAll_ewf.action?page=${pb.page-1}">上页</a>
      	</s:if>
      	<s:else>
      		上页
      	</s:else>
      </td>
      <td>
      	<s:if test="#session.pb.page<#session.pb.maxpage">	
      		<a href="findAll_ewf.action?page=${pb.page+1}">下页</a>
      	</s:if>
      	<s:else>
      		下页
      	</s:else>
      </td>
      <td>
      	<s:if test="#session.pb.page<#session.pb.maxpage">	
      		<a href="findAll_ewf.action?page=${pb.maxpage}">末页</a>
      	</s:if>
      	<s:else>
      		末页
      	</s:else>
      </td>
      <td>每页
        <label for="rows"></label>
      <input name="rows" value="${pb.rows}" type="text" id="rows" size="1" />
      条
      记录
      <input type="button" name="button" id="button" value="确定" onclick="dochangeRow()" /></td>
      <td>跳转到第
        <label for="page"></label>
        <input name="page"  value="${pb.page}"  type="text" id="page" size="1" />
        页
<input type="button" name="button2" id="button2" value="确定" onclick="dochangePage()"/></td>
      <td>${pb.page}/${pb.maxpage}页</td>
    </tr>
  </table>
</form>
<hr />
  </body>
</html>
